<?php

namespace Common\Service;

/** 
 * 图标管理
 * @author Legend. <xcx_legender@qq.com>
 * @param 
 * @return 
 */

Class IconService extends BaseService
{


	/** 
	 id
	 pack_id  包id
	 name, pic, 
	 */

    const ERROR_NAME  = '标题不能为空';
	const ERROR_PACK  = '包信息错误';
	const ERROR_PIC   = '图片不能为空';

	protected $_validate = array(
		array('name', 'require', self::ERROR_NAME, self::MUST_VALIDATE , 'regex', self::MODEL_BOTH),
		array('pack_id', 'require', self::ERROR_PACK, self::MUST_VALIDATE , 'regex', self::MODEL_BOTH),
		array('pic', 'require', self::ERROR_PIC, self::MUST_VALIDATE , 'regex', self::MODEL_BOTH)
	);

	protected $_auto = array(
        array('name', 'htmlspecialchars', self::MODEL_BOTH, 'function'),
        array('create_time', NOW_TIME, self::MODEL_INSERT),
        array('update_time', NOW_TIME, self::MODEL_BOTH),
        array('status', 1, self::MODEL_BOTH),
        array('status', 'intval', self::MODEL_BOTH, 'function'),
        array('pack_id', 'intval', self::MODEL_BOTH, 'function')
    ); 

}